Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Collections.​ObjectModel.​ReadOnlyDictionary<​TKey, TValue>
Assembly: System.Runtime
Inheritance: object → ReadOnlyDictionary
Implemented Interfaces
- Generic.​IDictionary`2 (Inherits: ICollection<​KeyValuePair<​TKey, TValue>>IEnumerable<​KeyValuePair<​TKey, TValue>>IEnumerable)
- Generic.​IReadOnlyDictionary`2 (Inherits: IEnumerable<​KeyValuePair<​TKey, TValue>>IEnumerableIReadOnlyCollection<​KeyValuePair<​TKey, TValue>>)
- IDictionary (Inherits: ICollectionIEnumerable)
Represents a read-only, generic collection of key/value pairs.
Properties
public
int
Count
Gets the number of items in the dictionary.
protected
Generic.​IDictionary<​TKey, TValue>
Dictionary
Gets the dictionary that is wrapped by this <see cref="T:System.Collections.ObjectModel.ReadOnlyDictionary`2" /> object.
public static
ReadOnlyDictionary<​TKey, TValue>
Empty
Gets an empty <see cref="T:System.Collections.ObjectModel.ReadOnlyDictionary`2" /> .
public
TValue
Item
public
KeyCollection<​TKey, TValue>
Keys
Gets a key collection that contains the keys of the dictionary.
public
ValueCollection<​TKey, TValue>
Values
Gets a collection that contains the values in the dictionary.
Methods
public
bool
ContainsKey​(TKey key)
Determines whether the dictionary contains an element that has the specified key.
Returns <see langword="true" /> if the dictionary contains an element that has the specified key; otherwise, <see langword="false" /> .
key
The key to locate in the dictionary.
public
Generic.​IEnumerator<​Generic.​KeyValuePair<​TKey, TValue>>
GetEnumerator​()
Returns an enumerator that iterates through the <see cref="T:System.Collections.ObjectModel.ReadOnlyDictionary`2" /> .
Returns An enumerator that can be used to iterate through the collection.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.